#include<iostream>
using namespace std;
class CXGraph {
private:
	int n;
public:
	CXGraph(int N=0):n(N){}
	CXGraph(const CXGraph& a) {
		n = a.n;
	}
	friend CXGraph operator ++(CXGraph& a) {
		if (a.n < 21) {
			a.n += 2;
		}
		return a;
	}
	friend CXGraph operator ++(CXGraph& a, int) {
		CXGraph b(a);
		if (a.n < 21) {
			a.n += 2;
		}
		return b;
	}
	friend CXGraph operator --(CXGraph& a) {
		if (a.n > 1) {
			a.n -= 2;
		}
		return a;
	}
	friend CXGraph operator --(CXGraph& a, int) {
		CXGraph b(a);
		if (a.n > 1) {
			a.n -= 2;
		}
		return b;
	}
	friend ostream & operator << (ostream& output, CXGraph const& a)
	{
		int i, j, k = a.n;
		for (i = 0; i < (a.n + 1) / 2; i++)
		{
			for (j = 0; j < (a.n - k) / 2; j++)
				output << " ";
			for (j = k; j > 0; j--)
				output << "X";
			output << endl;
			k = k - 2;
		}
		k = 3;
		for (i = (a.n + 1) / 2; i < a.n; i++)
		{
			for (j = (a.n - k) / 2; j > 0; j--)
				output << " ";
			for (j = 0; j < k; j++)
				output << "X";
			output << endl;
			k = k + 2;
		}
		return output;
	}
};
int main()
{
	int t, n;
	string command;
	cin >> n;
	CXGraph xGraph(n);
	cin >> t;
	while (t--)
	{
		cin >> command;
		if (command == "show++")
		{
			cout << xGraph++ << endl;
		}
		else if (command == "++show")
		{
			cout << ++xGraph << endl;
		}
		else if (command == "show--")
		{
			cout << xGraph-- << endl;
		}
		else if (command == "--show")
		{
			cout << --xGraph << endl;
		}
		else if (command == "show")
		{
			cout << xGraph << endl;
		}
	}
	return 0;
}